<template>
  <div class="container">
    <type-message v-if=" this.$store.state.lotteryType != 'pk10'"></type-message>
    <type-message-bj v-if="this.$store.state.lotteryType == 'pk10'"></type-message-bj> 
    <!-- 历史开奖-走势分析-预测计划组件 -->
    <history-plan-analyze @sendIndexToParentLotteryHis="showHisTabsContent" @sendIndexToParentForecastPlan="getPlanClickObj" @sendIndexToParentAnalyze="showAnalyzeTableContent"></history-plan-analyze>
    <!-- 底部表格区域路由 -->
    <router-view :key="this.$route.path" :hisClickIndex="LLPageHisIndex" :planClickIndex="LLPagePlanIndex" :analyzeClickIndex="LLPageAnalyzeIndex"></router-view>
  </div>
</template>

<script>
import TypeMessage from "./components/TypeMessage";
import TypeMessageBj from "../bj10/TypeMessageBj"
import HistoryPlanAnalyze from "./components/HistoryPlanAnalyze";

export default {
  components: {
    TypeMessage,
    TypeMessageBj,
    HistoryPlanAnalyze
  },
  data() {
    return {
      LLPageHisIndex: null,//历史开奖点击tabs的索引
      LLPagePlanIndex: null,//预测计划点击tabs的索引
      LLPageAnalyzeIndex: null,//走势分析点击tabs的索引
    };
  },
  methods: {
    //路由至历史开奖
    showHisTabsContent(data) {
      this.LLPageHisIndex = data;
      this.$router.push(`/lotterylobby/${this.$route.params.caizhongID}`);
    },

    //路由至预测计划
    getPlanClickObj(data) {
      this.LLPagePlanIndex = data;
      this.$router.push(`/lotterylobby/${this.$route.params.caizhongID}/forecastplan`);
    },

    //路由至走势分析
    showAnalyzeTableContent(data) {
      this.LLPageAnalyzeIndex = data;
      switch (data[1]) {
        case "号码统计":
          data[1] = "hmtj";
          break;
        case "冷热分析":
          data[1] = "lrfx";
          break;
        case "遗漏分析":
          data[1] = "ylfx";
          break;
        case "横版走势":
          data[1] = "hbzs";
          break;
        default:
          return;
      }
      this.$router.push(`/lotterylobby/${this.$route.params.caizhongID}/analyze/${data[1]}`);
    }
  }
};
</script>

<style lang="less">
@import url(../../assets/css/lotterylobby.less);
</style>

